# Maintainer: David Runge <dvzrv@archlinux.org>

_name=geographiclib
pkgname=python-geographiclib
pkgver=2.0
pkgrel=3
pkgdesc="Python implementation of the geodesic routines in GeographicLib"
arch=(any)
url="https://geographiclib.sourceforge.io/1.50/python/"
license=(MIT)
depends=(python)
makedepends=(python-build python-installer python-setuptools python-wheel)
checkdepends=(python-pytest)
source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz)
sha512sums=('08e67317b83ed96dc45b013bfc0eac771f015250da07b1574252f566f48ce944ad0a5a0623b1bfc96c14e65658f2f39a069af5ceb6ffe153677cc2a023eeef91')
b2sums=('31759eda6b77b191c34c18c2c6abdcf04214391e7d77eb68aa000aff8ec35519ab705b358f76bb0a50aff74708bcada664bdf3a97a3fb3e482ca773d6f410eed')

build() {
  cd $_name-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_name-$pkgver
  pytest -vv
}

package() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"
  install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}
